<form action="{:U('Questionnaire/delete')}" method="post">
<div class="table-tools">
    <button type="submit" class="btn btn-primary" title="删除勾选的问卷"><i class="glyphicon glyphicon-remove"></i> 删 除 </button>
    <a href="{:U('Questionnaire/add')}" class="btn btn-info" title="添加问卷"><i class="fa fa-copy"></i> 添 加 </a>
    <p>问卷列表</p>
</div>

<table id="questionnaire-table" class="table table-striped table-hover table-condensed datatable">
    <thead>
        <tr>
            <th>序号</th>
            <th>类型</th>
            <th>名称</th>
            <th>描述</th>
            <th>创建日期</th>
            <th>失效日期</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
    	<volist name="questionnaires" id="questionnaire">
    		<tr>
    			<td><input name='id[]' type="checkbox" value="{$questionnaire.id}" /> {$i}</td>
    			<td>
                    <switch name="questionnaire.type">
                        <case value="survey">
                            <span class="label label-danger"><i class="fa fa-tag"></i>调研卷</span>
                        </case>
                        <case value="exam">
                            <span class="label label-warning"><i class="fa fa-tag"></i>考试卷</span>
                        </case>
                    </switch> 
    			</td>
    			<td class="questionnaire_name">{$questionnaire.name}</td>
    			<td class="questionnaire_desc">{$questionnaire.description|mb_substr=0,30,'utf-8'}...</td>
    			<td>{$questionnaire.create_date}</td>
    			<td>{$questionnaire.expire_date}</td>
    			<td>
                    <a href="{:U('Questionnaire/edit', array('id' => $questionnaire['id']))}" class="btn btn-default btn-rounded btn-condensed btn-sm" title="编辑问卷"><span class="fa fa-pencil"></span>
                    </a>
                    <a href="{:U('Questions/index', array('questionnaire_id' => $questionnaire['id']))}" class="btn btn-default btn-rounded btn-condensed btn-sm" title="问卷配题"><span class="fa fa-list-ul"></span></a>
                    <a href="{:U('Questionnaire/delete', array('id' => $questionnaire['id']))}" class="btn btn-danger btn-rounded btn-condensed btn-sm" title="删除问卷"><span class="fa fa-times"></span></a>
    			</td>
    		</tr>
    	</volist>
    </tbody>
</table>
</form>